$(function () {
    var fn = ABUS.Fn;
    var listData = [];

    //页面滚动
    document.addEventListener('touchmove', function (e) {
        e.preventDefault();
        isDrag = true;
    }, {passive: false});

    $(document.body).on("touchend", ".member_right a",function (e) {
        window.location = "tel://" + $(this).text()
    });
    fn.get({
        url: "/leader/my/members",
        success: function (data) {
            $("#member_list").renderTemp(data);
            listData = data.data;
            new IScroll('#member_list', {mouseWheel: true});
        }
    });
    $("#member_list").on("touchend", "li .float_right", function () {
        if (isDrag) {
            isDrag = false;
            return true;
        }
        var data = listData[$(this).closest('li').index()];
        fn.page_goto({
            url: "./zuzhang_wode_memberOrder.html",
            data:data
        })
    });

    $("#searchInput").on('input', function () {
        var val = $.trim($(this).val());
        var $el = $("#member_list");
        if(val === '')
            $el.find("li").show();
        else {
            $el.find("li").hide();
            $el.find("li:contains(" + val + ")").show();
        }
    })
});